﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace RSALicCore
{
    /// <summary>
    /// 秘钥对生成器
    /// </summary>
    public class KeyMaker
    {
        /// <summary>
        /// 生成秘钥对
        /// </summary>
        /// <returns>pubkey prikey</returns>
        public static string[] Make()
        {
            var rsa = new RSACryptoServiceProvider();
            var pubkey = rsa.ToXmlString(false);
            var prikey = rsa.ToXmlString(true);

            return new string[2] { pubkey, prikey};
        }
    }
}
